package jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author wangpp
 */
public class SampleInvokeHandler implements InvocationHandler {
    private Object source;

    public SampleInvokeHandler(Object source) {
        this.source = source;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("====before====");

        Object result = method.invoke(source, args);

        System.out.println("====after====");
        return result;
    }
}
